package com.yc.book.dao;

import java.sql.SQLException;
import java.util.Map;

import com.yc.api.d1026.DBHelper;

public class ReaderDao {
	
	public static void main(String[] args) throws SQLException {
		new ReaderDao().selectForLogin("test", "123");
	}
	
	/**
	 * 登录查询
	 * @param name  用户名
	 * @param pwd   密码
	 * @return      果然查询有该用户, 返回用户信息map集合, 否则null
	 * @throws SQLException 
	 */
	public Map<String,Object> selectForLogin(String name, String pwd) throws SQLException{
		String sql = "select * from reader where name=? and pwd=?";
		return DBHelper.selectOneMap(sql, name, pwd);
	}

}
